package com.ruoyi.drone.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.drone.mapper.DroneOrganizationMapper;
import com.ruoyi.drone.domain.DroneOrganization;
import com.ruoyi.drone.service.IDroneOrganizationService;

/**
 * 组织方信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-01
 */
@Service
public class DroneOrganizationServiceImpl implements IDroneOrganizationService 
{
    @Autowired
    private DroneOrganizationMapper droneOrganizationMapper;

    /**
     * 查询组织方信息
     * 
     * @param orgId 组织方信息主键
     * @return 组织方信息
     */
    @Override
    public DroneOrganization selectDroneOrganizationByOrgId(Long orgId)
    {
        return droneOrganizationMapper.selectDroneOrganizationByOrgId(orgId);
    }

    /**
     * 根据用户ID查询组织方信息
     * 
     * @param userId 用户ID
     * @return 组织方信息
     */
    @Override
    public DroneOrganization selectDroneOrganizationByUserId(Long userId)
    {
        return droneOrganizationMapper.selectDroneOrganizationByUserId(userId);
    }

    /**
     * 查询组织方信息列表
     * 
     * @param droneOrganization 组织方信息
     * @return 组织方信息
     */
    @Override
    public List<DroneOrganization> selectDroneOrganizationList(DroneOrganization droneOrganization)
    {
        return droneOrganizationMapper.selectDroneOrganizationList(droneOrganization);
    }

    /**
     * 新增组织方信息
     * 
     * @param droneOrganization 组织方信息
     * @return 结果
     */
    @Override
    public int insertDroneOrganization(DroneOrganization droneOrganization)
    {
        droneOrganization.setCreateTime(DateUtils.getNowDate());
        return droneOrganizationMapper.insertDroneOrganization(droneOrganization);
    }

    /**
     * 修改组织方信息
     * 
     * @param droneOrganization 组织方信息
     * @return 结果
     */
    @Override
    public int updateDroneOrganization(DroneOrganization droneOrganization)
    {
        droneOrganization.setUpdateTime(DateUtils.getNowDate());
        return droneOrganizationMapper.updateDroneOrganization(droneOrganization);
    }

    /**
     * 批量删除组织方信息
     * 
     * @param orgIds 需要删除的组织方信息主键
     * @return 结果
     */
    @Override
    public int deleteDroneOrganizationByOrgIds(Long[] orgIds)
    {
        return droneOrganizationMapper.deleteDroneOrganizationByOrgIds(orgIds);
    }

    /**
     * 删除组织方信息信息
     * 
     * @param orgId 组织方信息主键
     * @return 结果
     */
    @Override
    public int deleteDroneOrganizationByOrgId(Long orgId)
    {
        return droneOrganizationMapper.deleteDroneOrganizationByOrgId(orgId);
    }
}
